def validate_password():
    password = input()
    violations = []
    if len(password) < 8:
        violations.append(1)
    if not password.isalnum():
        violations.append(2)
    has_upper = any(char.isupper() for char in password)
    has_digit = any(char.isdigit() for char in password)
    if not has_upper or not has_digit:
        violations.append(3)
    if not violations:
        print(0)
    else:
        for violation in sorted(set(violations)):
            print(violation)

validate_password()